package cn.jly.spring.boot.cloud.service.impl;

import cn.jly.spring.boot.cloud.beans.User;
import cn.jly.spring.boot.cloud.dao.UserRepository;
import cn.jly.spring.boot.cloud.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author lanyangji
 * @description
 * @date 2020/12/2 上午 11:01
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public List<User> deleteAllByUsernameContains(String username) {
        return userRepository.deleteAllByUsernameContains(username);
    }
}
